package com.example.demo.controller;

import com.example.demo.dto.MajorManagementResultDTO;
import com.example.demo.service.MajorManagementService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/major-management")
@CrossOrigin
public class MajorManagementController {

    @Autowired
    private MajorManagementService majorManagementService;

    @Operation(summary = "获取所有专业及其学生测试结果")
    @GetMapping("/results")
    public List<MajorManagementResultDTO> getMajorResults() {
        return majorManagementService.getMajorResults();
    }
}
